/*特色服务区逻辑代码
-----------------------------------------------------------------*/

//获取左侧导航部分 a 标签
var contentLeftNavA = document.querySelectorAll(".content-left-nav a");

//获取右侧内容区内容
var contentRightDiv = document.querySelectorAll(".content-right>div")

for (let i = 0;i < contentLeftNavA.length;i ++) {

    contentLeftNavA[i].index = i;

    contentLeftNavA[i].addEventListener('click', function (params) {

        //清除所有 a 标签外层的父元素 li 的类名
        for (let i = 0;i < contentLeftNavA.length;i ++) {
            contentLeftNavA[i].parentNode.className = "";
        }

        //为当前点击的按钮添加类名
        this.parentNode.className = "active";

        for (let i = 0;i < contentRightDiv.length;i ++) {
            contentRightDiv[i].style.display = "none";
        }

        

        contentRightDiv[this.index].style.display = "block"


    }, false)
}